package com.rykj.qxj.server.services.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.rykj.qxj.server.dao.ApiRequestParamMapper;
import com.rykj.qxj.server.model.entity.ApiRequestParam;
import com.rykj.qxj.server.services.IApiRequestParamService;

@Service
public class ApiRequestParamServiceImpl implements IApiRequestParamService {
	
	@Autowired
	private ApiRequestParamMapper apiRequestParamMapper;
	
	public void saveRequestParam(List<ApiRequestParam> requestParamList){
		for (ApiRequestParam apiRequestParam : requestParamList) {
			apiRequestParamMapper.insert(apiRequestParam);
			
		}
	}
	public void deleteRequestParam(Integer id){
		ApiRequestParam requestParam = apiRequestParamMapper.selectByPrimaryKey(id);
		apiRequestParamMapper.delete(requestParam);
		
	}
	
	public List<ApiRequestParam> selectApiRequestParamListByApiVersionId(Integer apiVersionId){
		return apiRequestParamMapper.selectApiRequestParamListByApiVersionId(apiVersionId);
		
	}
}
